/* difftime example */
#include <stdio.h>      /* printf */
#include <time.h>       /* time_t, struct tm, difftime, time, mktime */
#include <unistd.h>
int main ()
{
  time_t now;
  time_t later;
  double seconds;

  time(&now);  /* get current time; same as: now = time(NULL)  */
  sleep(5);
  time(&later);

  seconds = difftime(later,now);

  printf ("%.f seconds since new year in the current timezone.\n", seconds);

  return 0;
}